%rebase('main.html')
%include('admin_head_men.html')

<form class="form-horizontal" method="post" action="/admin/content/edit/{{res[0]['id']}}">
  <div class="form-group">
    <label  class="col-sm-1 control-label">标题</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="title"  value="{{res[0]['tname']}}">
    </div>
  </div>

   <div class="form-group">
    <label  class="col-sm-1 control-label">分类</label>
    <div class="col-sm-10">
      <select class="form-control" name="cate_id">
          %for i in cates:
          %if i['id']==res[0]['cid']:
         <option value="{{i['id']}}" selected>{{i['cname']}}</option>
          %else:
          <option value="{{i['id']}}">{{i['cname']}}</option>
          %end
          %end
    </select>
    </div>
  </div>


  <div class="form-group">
    <label  class="col-sm-1 control-label">标签</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" name="tag" placeholder="标签" value="{{res[0]['tag']}}">
    </div>
  </div>
    <div class="form-group">
        <label  class="col-sm-1 control-label">文章内容</label>

        <div class="col-sm-10">
    <textarea class="ckeditor" cols="10" id="editor4" rows="10" tabindex="1" name="comment">
        {{!res[0]['content']}}
    </textarea>
            </div>
   </div>
  <div class="form-group">

    <div class="col-sm-offset-5 col-sm-10">
      <button type="submit" class="btn btn-info" >确认更新</button>
        <a href="/admin" class="btn btn-info" >取消返回</a>
    </div>
  </div>
</form>

<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor', {
        initialFrameWidth : 'auto',
        initialFrameHeight: '520',
        serverUrl: "/upload"
    });
</script>





